
******************************************************
***************** TABLE A.5 *******************
use "${ddata}cleaned_data_wACSweight.dta", clear 


foreach v in white age male college married working_ft child_under_6 child_under_18 lincome sce_date {

	gen `v'_missing = (`v'==.)

}
gen  current_censusdiv_missing = ( current_censusdiv=="")

**************************!
global demographics white age male college married working_ft child_under_6 child_under_18 lincome i.sce_date i.current_censusdiv

global demographics_missing	white_missing age_missing male_missing college_missing married_missing working_ft_missing child_under_6_missing child_under_18_missing ///
	lincome_missing sce_date_missing current_censusdiv_missing
**************************!

capture program drop store_reg
program define store_reg, rclass

	matrix B = e(b)
	matrix V = e(V)

	local b = string(B[1,1],  "%8.2fc")
	local se = "(" + string(sqrt(V[1,1]), "%8.2fc") + ")"
	local p = 2*ttail(e(df_r),abs(B[1,1]/sqrt(V[1,1])))
	local star=""
	if `p' >.05 & `p' <=.10 { 	
		local star = "$ds^{*}$ds"
	}
	if `p' >.01 & `p' <=.05 { 	
		local star = "$ds^{**}$ds"
	}
	if `p' <=.01 {	
		local star = "$ds^{***}$ds" 
	}

	local p_val=string(`p', "%10.3fc")

	return local beta = "`b'"
	return local se = "`se'"
	return local star = "`star'"
	return local pvalue= "`p_val'"

end



forvalues i = 0/5{

	xi: reg qs2_`i' treatment $demographics_missing [aw=weight_ACS], robust 
	store_reg 
	local qs2_`i'_all = "`r(beta)'`r(star)'"
	local qs2_`i'_all_se = "`r(se)'"
	local qs2_`i'_all_obs = e(N)

	xi: reg qs2_`i' treatment $demographics_missing [aw=weight_ACS] if male==0 , robust 
	store_reg 
	local qs2_`i'_female = "`r(beta)'`r(star)'"
	local qs2_`i'_female_se = "`r(se)'"
	local qs2_`i'_female_obs = e(N)

	xi: reg qs2_`i' treatment $demographics_missing [aw=weight_ACS] if male==1, robust 
	store_reg 
	local qs2_`i'_male = "`r(beta)'`r(star)'"
	local qs2_`i'_male_se = "`r(se)'"
	local qs2_`i'_male_obs = e(N)

}


forvalues i = 0/5{

	xi: reg qs2_`i' treatment $demographics  [aw=weight_ACS] , robust
	store_reg 
	local qs2_`i'_control_all = "`r(beta)'`r(star)'"
	local qs2_`i'_control_all_se = "`r(se)'"
	local qs2_`i'_control_all_obs = e(N)

	xi: reg qs2_`i' treatment $demographics [aw=weight_ACS] if male==0, robust
	store_reg 
	local qs2_`i'_control_female = "`r(beta)'`r(star)'"
	local qs2_`i'_control_female_se = "`r(se)'"
	local qs2_`i'_control_female_obs = e(N)

	xi: reg qs2_`i' treatment $demographics [aw=weight_ACS] if male==1, robust
	store_reg 
	local qs2_`i'_control_male = "`r(beta)'`r(star)'"
	local qs2_`i'_control_male_se = "`r(se)'"
	local qs2_`i'_control_male_obs = e(N)

}

texdoc init "${o}TableA5_ACSweighted_final.tex", replace force
tex \begin{tabular}{lcccccc} 
tex \toprule

tex &\multirow{1}{*}{Mother Rejects}&\multicolumn{5}{c}{Mother takes time off if she earns [...] than spouse} \\
tex \cline{3-7} &\multicolumn{1}{c}{Offer}&\multicolumn{1}{c}{15\% Less}&\multicolumn{1}{c}{Same}&\multicolumn{1}{c}{15\% More}&\multicolumn{1}{c}{30\% More}&\multicolumn{1}{c}{50\% More} \\

tex \midrule

tex \multicolumn{2}{c}{\textbf{Panel A: Without Controls }}\\
tex \textbf{All} & & & & & & \\
tex treatment &`qs2_0_all'    & `qs2_1_all'    & `qs2_2_all'    & `qs2_3_all'    & `qs2_4_all'    & `qs2_5_all' \\
tex  & `qs2_0_all_se'    & `qs2_1_all_se'    & `qs2_2_all_se'    & `qs2_3_all_se'    & `qs2_4_all_se'    & `qs2_5_all_se' \\
tex obs  & `qs2_0_all_obs'    & `qs2_1_all_obs'    & `qs2_2_all_obs'    & `qs2_3_all_obs'    & `qs2_4_all_obs'    & `qs2_5_all_obs' \\
tex \textbf{Women} & & & & & & \\
tex treatment & `qs2_0_female' & `qs2_1_female' & `qs2_2_female' & `qs2_3_female' & `qs2_4_female' & `qs2_5_female' \\
tex  & `qs2_0_female_se' & `qs2_1_female_se' & `qs2_2_female_se' & `qs2_3_female_se' & `qs2_4_female_se' & `qs2_5_female_se' \\
tex obs & `qs2_0_female_obs' & `qs2_1_female_obs' & `qs2_2_female_obs' & `qs2_3_female_obs' & `qs2_4_female_obs' & `qs2_5_female_obs' \\
tex \textbf{Men} & & & & & & \\
tex treatment & `qs2_0_male'   & `qs2_1_male'   & `qs2_2_male'   & `qs2_3_male'   & `qs2_4_male'   & `qs2_5_male' \\
tex  & `qs2_0_male_se'   & `qs2_1_male_se'   & `qs2_2_male_se'   & `qs2_3_male_se'   & `qs2_4_male_se'   & `qs2_5_male_se' \\
tex obs & `qs2_0_male_obs'   & `qs2_1_male_obs'   & `qs2_2_male_obs'   & `qs2_3_male_obs'   & `qs2_4_male_obs'   & `qs2_5_male_obs' \\
tex \\
tex \multicolumn{2}{c}{\textbf{Panel B: With Controls }}\\
tex \textbf{All} & & & & & & \\
tex treatment & `qs2_0_control_all'    & `qs2_1_control_all'    & `qs2_2_control_all'    & `qs2_3_control_all'    & `qs2_4_control_all'    & `qs2_5_control_all' \\
tex  & `qs2_0_control_all_se'    & `qs2_1_control_all_se'    & `qs2_2_control_all_se'    & `qs2_3_control_all_se'    & `qs2_4_control_all_se'    & `qs2_5_control_all_se' \\
tex obs & `qs2_0_control_all_obs'    & `qs2_1_control_all_obs'    & `qs2_2_control_all_obs'    & `qs2_3_control_all_obs'    & `qs2_4_control_all_obs'    & `qs2_5_control_all_obs' \\
tex \textbf{Women} & & & & & & \\
tex treatment & `qs2_0_control_female' & `qs2_1_control_female' & `qs2_2_control_female' & `qs2_3_control_female' & `qs2_4_control_female' & `qs2_5_control_female' \\
tex  & `qs2_0_control_female_se' & `qs2_1_control_female_se' & `qs2_2_control_female_se' & `qs2_3_control_female_se' & `qs2_4_control_female_se' & `qs2_5_control_female_se' \\
tex obs & `qs2_0_control_female_obs' & `qs2_1_control_female_obs' & `qs2_2_control_female_obs' & `qs2_3_control_female_obs' & `qs2_4_control_female_obs' & `qs2_5_control_female_obs' \\
tex \textbf{Men} & & & & & & \\
tex treatment & `qs2_0_control_male'   & `qs2_1_control_male'   & `qs2_2_control_male'   & `qs2_3_control_male'   & `qs2_4_control_male'   & `qs2_5_control_male' \\
tex  & `qs2_0_control_male_se'   & `qs2_1_control_male_se'   & `qs2_2_control_male_se'   & `qs2_3_control_male_se'   & `qs2_4_control_male_se'   & `qs2_5_control_male_se' \\
tex obs & `qs2_0_control_male_obs'   & `qs2_1_control_male_obs'   & `qs2_2_control_male_obs'   & `qs2_3_control_male_obs'   & `qs2_4_control_male_obs'   & `qs2_5_control_male_obs' \\

tex \bottomrule
tex \end{tabular}

texdoc close




